//
//  SXHomeCollectionViewCell.m
//  NetEase-News
//
//  Created by 沈欣 on 2017/9/12.
//  Copyright © 2017年 沈欣. All rights reserved.
//

#define RGBColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1]

#define RandomColor RGBColor(arc4random_uniform(255), arc4random_uniform(255), arc4random_uniform(255))

#import "SXHomeCollectionViewCell.h"
#import "SXNewsTableViewController.h"

@implementation SXHomeCollectionViewCell{
    SXNewsTableViewController *_newsVC;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    
    _newsVC = [SXNewsTableViewController new];
    [self.contentView addSubview:_newsVC.tableView];
    _newsVC.tableView.frame = self.contentView.bounds;
    
    _newsVC.tableView.backgroundColor = RandomColor;
}

- (void)setURLString:(NSString *)URLString {
    _URLString = URLString;
    
    //把新闻数据地址,传入到NewsVC
    _newsVC.URLString = URLString;
}

@end
